<extend name="alizi" />
<block name="body">
<div class="alizi-order-wrap clearfix">
    <div class="alizi-detail-wrap">
        {$info.content}
        <script type="text/javascript">
        seajs.use(['alizi','jquery/form','lang'],function(alizi){
            window.alizi = alizi;
            alizi.quantity(0);
            var btnSubmit = $('.alizi-submit');
            $('#aliziForm').ajaxForm({
                cache: true,
                timeout: 50000,
                dataType: 'json',
                error:function(){ layer.closeAll(); alert(lang.ajaxError); btnSubmit.attr('disabled',false).val(lang.submit); },
                beforeSubmit:function(){
                    if(checkForm('#aliziForm')==false) return false;
                    layer.closeAll();layer.load();
                    btnSubmit.attr('disabled',true).val(lang.loading);
                },
                success:function(data){
                    layer.closeAll();layer.closeAll();
                    if(data.status=='1'){
                        var redirect = "{:U('Order/pay',array('order_no'=>'__orderNo__'))}";
                        top.window.location.href = redirect.replace('__orderNo__',data.data.order_no);
                    }else{
                        btnSubmit.attr('disabled',false).val(lang.submit);
                        layer.msg(data.info);
                    }
                }
            });
        });
        if(self!=top){
            height();window.onresize=function(){height();}
            function height(){ try{var height=parseInt(document.body.clientHeight);parent.window.document.getElementById("aliziIframe").height = height;}catch (ex){console.log(ex);}}
        }
        </script>
    </div>
</div>

<if condition="C('DEFAULT_LANG') neq 'zh-cn' && !empty($aliziConfig['facebook_pixel_id'])">
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '{$aliziConfig.facebook_pixel_id}', {em: 'insert_email_variable,'}); 
fbq('track', 'PageView');
fbq('track', 'AddToCart'); 
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id={$aliziConfig.facebook_pixel_id}&ev=PageView&noscript=1" /></noscript>
<!-- DO NOT MODIFY -->
<!-- End Facebook Pixel Code -->
</if>


</block>